Make this work for list == NULL. (Coverity)
authorMatthias Clasen <mclasen@redhat.com>
Wed, 12 Apr 2006 18:38:40 +0000 (18:38 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 12 Apr 2006 18:38:40 +0000 (18:38 +0000)
2006-04-12  Matthias Clasen  <mclasen@redhat.com>

* gdk/x11/gdkselection-x11.c (make_list): Make this work
for list == NULL.  (Coverity)

ChangeLog
ChangeLog.pre-2-10
gdk/x11/gdkselection-x11.c

index b21c2368811cda4cc361791a3bc24ef549ea8631..14da8891ef16c66e9c408153ab780e0624997002 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-04-12  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkselection-x11.c (make_list): Make this work
+       for list == NULL.  (Coverity)
+
        * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_entries_for_keycode): 
        Rearrange the code a bit.
 
index b21c2368811cda4cc361791a3bc24ef549ea8631..14da8891ef16c66e9c408153ab780e0624997002 100644 (file)
@@ -1,5 +1,8 @@
 2006-04-12  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkselection-x11.c (make_list): Make this work
+       for list == NULL.  (Coverity)
+
        * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_entries_for_keycode): 
        Rearrange the code a bit.
 
index 9bf7e478b5de6ebd6f64c0d9f813a7aeefd7e0ec..c15d1f5abfbce5a68b79a4cbe41ef492c0028a7d 100644 (file)
@@ -536,10 +536,11 @@ make_list (const gchar  *text,
     }
 
   if (list)
-    *list = g_new (gchar *, n_strings + 1);
-
-  (*list)[n_strings] = NULL;
-  
+    {
+      *list = g_new (gchar *, n_strings + 1);
+      (*list)[n_strings] = NULL;
+    }
+     
   i = n_strings;
   tmp_list = strings;
   while (tmp_list)
@@ -548,10 +549,10 @@ make_list (const gchar  *text,
        (*list)[--i] = tmp_list->data;
       else
        g_free (tmp_list->data);
-
+      
       tmp_list = tmp_list->next;
     }
-
+  
   g_slist_free (strings);
 
   return n_strings;